package net.chrisrichardson.cloudtools.maven.plugins;

import java.io.File;

import net.chrisrichardson.ec2deployer.cluster.ClusterCheckpoint;
import net.chrisrichardson.ec2deployer.cluster.ClusterManager;
import net.chrisrichardson.ec2deployer.cluster.SimpleCluster;

/**
 * @goal createcheckpoint
 * 
 */
public class CreateCheckpointMojo extends AbstractClusterMojo {

  /**
   * @parameter expression="${cloudtools.checkpoint.file}
   * @required
   */
  protected File checkpointFile;

 @Override
  protected void executeWithCluster(ClusterManager manager, SimpleCluster cluster) {
    ClusterCheckpoint checkpoint = cluster.getClusterInstance().createCheckpoint();
    checkpoint.writeXmlToFile(checkpointFile);
  }
}
